home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / language / iconv8_s.arc / ICONT.ARC / TOKTAB.C < prev    next >
C/C++ Source or Header  |  1990-03-28  |  10KB  |  171 lines

  1. #include "..\h\config.h"
  2. #include "general.h"
  3. #include "tproto.h"
  4. #include "trans.h"
  5. #include "tlex.h"
  6. #include "token.h"
  7.  
  8. /*
  9.  * Token table - contains an entry for each token type
  10.  * with printable name of token, token type, and flags
  11.  * for semicolon insertion.
  12.  */
  13.  
  14. struct toktab toktab[] = {
  15. /*  token        token type    flags */
  16.  
  17.    /* primitives */
  18.    "identifier",      IDENT,         Beginner+Ender,    /*   0 */
  19.    "integer-literal", INTLIT,        Beginner+Ender,    /*   1 */
  20.    "real-literal",    REALLIT,       Beginner+Ender,    /*   2 */
  21.    "string-literal",  STRINGLIT,     Beginner+Ender,    /*   3 */
  22.    "cset-literal",    CSETLIT,       Beginner+Ender,    /*   4 */
  23.    "end-of-file",     EOFX,          0,                 /*   5 */
  24.  
  25.    /* reserved words */
  26.    "break",           BREAK,         Beginner+Ender,    /*   6 */
  27.    "by",              BY,            0,                 /*   7 */
  28.    "case",            CASE,          Beginner,          /*   8 */
  29.    "create",          CREATE,        Beginner,          /*   9 */
  30.    "default",         DEFAULT,       Beginner,          /*  10 */
  31.    "do",              DO,            0,                 /*  11 */
  32.    "else",            ELSE,          0,                 /*  12 */
  33.    "end",             END,           Beginner,          /*  13 */
  34.    "every",           EVERY,         Beginner,          /*  14 */
  35.    "fail",            FAIL,          Beginner+Ender,    /*  15 */
  36.    "global",          GLOBAL,        0,                 /*  16 */
  37.    "if",              IF,            Beginner,          /*  17 */
  38.    "initial",         INITIAL,       Beginner,          /*  18 */
  39.    "link",            LINK,          0,                 /*  19 */
  40.    "local",           LOCAL,         Beginner,          /*  20 */
  41.    "next",            NEXT,          Beginner+Ender,    /*  21 */
  42.    "not",             NOT,           Beginner,          /*  22 */
  43.    "of",              OF,            0,                 /*  23 */
  44.    "procedure",       PROCEDURE,     0,                 /*  24 */
  45.    "record",          RECORD,        0,                 /*  25 */
  46.    "repeat",          REPEAT,        Beginner,          /*  26 */
  47.    "return",          RETURN,        Beginner+Ender,    /*  27 */
  48.    "static",          STATIC,        Beginner,          /*  28 */
  49.    "suspend",         SUSPEND,       Beginner+Ender,    /*  29 */
  50.    "then",            THEN,          0,                 /*  30 */
  51.    "to",              TO,            0,                 /*  31 */
  52.    "until",           UNTIL,         Beginner,          /*  32 */
  53.    "while",           WHILE,         Beginner,          /*  33 */
  54.  
  55.    /* operators */
  56.    ":=",              ASSIGN,        0,                 /*  34 */
  57.    "@",               AT,            Beginner,          /*  35 */
  58.    "@:=",             AUGACT,        0,                 /*  36 */
  59.    "&:=",             AUGAND,        0,                 /*  37 */
  60.    "=:=",             AUGEQ,         0,                 /*  38 */
  61.    "===:=",           AUGEQV,        0,                 /*  39 */
  62.    ">=:=",            AUGGE,         0,                 /*  40 */
  63.    ">:=",             AUGGT,         0,                 /*  41 */
  64.    "<=:=",            AUGLE,         0,                 /*  42 */
  65.    "<:=",             AUGLT,         0,                 /*  43 */
  66.    "~=:=",            AUGNE,         0,                 /*  44 */
  67.    "~===:=",          AUGNEQV,       0,                 /*  45 */
  68.    "==:=",            AUGSEQ,        0,                 /*  46 */
  69.    ">>=:=",           AUGSGE,        0,                 /*  47 */
  70.    ">>:=",            AUGSGT,        0,                 /*  48 */
  71.    "<<=:=",           AUGSLE,        0,                 /*  49 */
  72.    "<<:=",            AUGSLT,        0,                 /*  50 */
  73.    "~==:=",           AUGSNE,        0,                 /*  51 */
  74.    "\\",              BACKSLASH,     Beginner,          /*  52 */
  75.    "!",               BANG,          Beginner,          /*  53 */
  76.    "|",               BAR,           Beginner,          /*  54 */
  77.    "^",               CARET,         Beginner,          /*  55 */
  78.    "^:=",             CARETASGN,     0,                 /*  56 */
  79.    ":",               COLON,         0,                 /*  57 */
  80.    ",",               COMMA,         0,                 /*  58 */
  81.    "||",              CONCAT,        Beginner,          /*  59 */
  82.    "||:=",            CONCATASGN,    0,                 /*  60 */
  83.    "&",               CONJUNC,       Beginner,          /*  61 */
  84.    ".",               DOT,           Beginner,          /*  62 */
  85.    "--",              DIFF,          Beginner,          /*  63 */
  86.    "--:=",            DIFFASGN,      0,                 /*  64 */
  87.    "===",             EQUIV,         Beginner,          /*  65 */
  88.    "**",              INTER,         Beginner,          /*  66 */
  89.    "**:=",            INTERASGN,     0,                 /*  67 */
  90.    "{",               LBRACE,        Beginner,          /*  68 */
  91.    "[",               LBRACK,        Beginner,          /*  69 */
  92.    "|||",             LCONCAT,       Beginner,          /*  70 */
  93.    "|||:=",           LCONCATASGN,   0,                 /*  71 */
  94.    "==",              LEXEQ,         Beginner,          /*  72 */
  95.    ">>=",             LEXGE,         0,                 /*  73 */
  96.    ">>",              LEXGT,         0,                 /*  74 */
  97.    "<<=",             LEXLE,         0,                 /*  75 */
  98.    "<<",              LEXLT,         0,                 /*  76 */
  99.    "~==",             LEXNE,         Beginner,          /*  77 */
  100.    "(",               LPAREN,        Beginner,          /*  78 */
  101.    "-:",              MCOLON,        0,                 /*  79 */
  102.    "-",               MINUS,         Beginner,          /*  80 */
  103.    "-:=",             MINUSASGN,     0,                 /*  81 */
  104.    "%",               MOD,           0,                 /*  82 */
  105.    "%:=",             MODASGN,       0,                 /*  83 */
  106.    "~===",            NOTEQUIV,      Beginner,          /*  84 */
  107.    "=",               NUMEQ,         Beginner,          /*  85 */
  108.    ">=",              NUMGE,         0,                 /*  86 */
  109.    ">",               NUMGT,         0,                 /*  87 */
  110.    "<=",              NUMLE,         0,                 /*  88 */
  111.    "<",               NUMLT,         0,                 /*  89 */
  112.    "~=",              NUMNE,         Beginner,          /*  90 */
  113.    "+:",              PCOLON,        0,                 /*  91 */
  114.    "+",               PLUS,          Beginner,          /*  92 */
  115.    "+:=",             PLUSASGN,      0,                 /*  93 */
  116.    "?",               QMARK,         Beginner,          /*  94 */
  117.    "<-",              REVASSIGN,     0,                 /*  95 */
  118.    "<->",             REVSWAP,       0,                 /*  96 */
  119.    "}",               RBRACE,        Ender,             /*  97 */
  120.    "]",               RBRACK,        Ender,             /*  98 */
  121.    ")",               RPAREN,        Ender,             /*  99 */
  122.    ";",               SEMICOL,       0,                 /* 100 */
  123.    "?:=",             SCANASGN,      0,                 /* 101 */
  124.    "/",               SLASH,         Beginner,          /* 102 */
  125.    "/:=",             SLASHASGN,     0,                 /* 103 */
  126.    "*",               STAR,          Beginner,          /* 104 */
  127.    "*:=",             STARASGN,      0,                 /* 105 */
  128.    ":=:",             SWAP,          0,                 /* 106 */
  129.    "~",               TILDE,         Beginner,          /* 107 */
  130.    "++",              UNION,         Beginner,          /* 108 */
  131.    "++:=",            UNIONASGN,     0,                 /* 109 */
  132.    "$(",              LBRACE,        Beginner,          /* 110 */
  133.    "$)",              RBRACE,        Ender,             /* 111 */
  134.    "$<",              LBRACK,        Beginner,          /* 112 */
  135.    "$>",              RBRACK,        Ender,             /* 113 */
  136.    "end-of-file",     0,             0,
  137.    };
  138.  
  139. /*
  140.  * restab[c] points to the first reserved word in toktab which
  141.  * begins with the let